package com.sunwayworld.basemodule.samplemanage.samplestaging.resource.impl;

import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.sunwayworld.basemodule.samplemanage.samplestaging.resource.LimsSampleStagingResource;
import com.sunwayworld.basemodule.samplemanage.samplestaging.service.LimsSampleStagingService;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import com.sunwayworld.framework.log.annotation.Log;
import com.sunwayworld.framework.log.annotation.LogModule;
import com.sunwayworld.framework.log.annotation.LogType;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;

@LogModule("样本暂存")
@RestController
@GikamBean
public class LimsSampleStagingResourceImpl implements LimsSampleStagingResource {

    @Autowired
    private LimsSampleStagingService limsSampleStagingService;

    @Override
    public LimsSampleStagingService getService() {
        return limsSampleStagingService;
    }

    @Log(value = "新增样本暂存", type = LogType.INSERT)
    @Override
    @RequestMapping(method = RequestMethod.POST)
    public Long insert(RestJsonWrapperBean wrapper) {
        return getService().insert(wrapper);
    }

    @Override
    @Log(value = "修改样本暂存状态", type = LogType.INSERT)
    public JSONObject changeStatus(RestJsonWrapperBean wrapperBean) {
        return getService().changeStatus(wrapperBean);
    }
}
